package com.github.thinwonton.spring.aop.service.impl;

import com.github.thinwonton.spring.aop.entity.User;
import com.github.thinwonton.spring.aop.service.UserService;
import org.springframework.stereotype.Service;

/**
 * Created by hugo on 2017/6/8.
 */
@Service
public class UserServiceImpl implements UserService {
    @Override
    public User getByName(String name) {
        System.out.println("getByName():" + name);
        return new User(1, name);
    }

    @Override
    public void deleteByName(String name) {
        System.out.println("deleteByName():" + name);
    }

    @Override
    public void update(User user) {
        System.out.println("update():" + user.toString());
        throw new RuntimeException("update()方法发生了异常");
    }
}
